<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="scripts/jquery/jquery-1.7.1.js"></script>
<link href="../style/authority/basic_layout.css" rel="stylesheet" type="text/css">
<link href="../style/authority/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../scripts/authority/commonAll.js"></script>
<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="../scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="../style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
<script type="text/javascript" src="../scripts/artDialog/artDialog.js?skin=default"></script>
<script type="text/javascript" src="../scripts/Myscripts/alpha_add.js"></script>
<title>信息管理系统</title>
<style>
	.alt td{ background:black !important;}
</style>
</head>
<body>
<div id = "add_alpha_id">
	<form id="submitForm" name="submitForm" action="" method="post">
		<div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">条件搜索</div>
						<div id="box_center" >
							任务类型&nbsp;&nbsp;
							<select name="txt_mission_type" id="txt_mission_type" class="ui_select01">
							<option value="" selected="selected"> </option>
                            <option value="送货">送货</option>
                            <option value="退货">退货</option>
                            <option value="换货">换货</option>
                        	</select>
                        	任务状态&nbsp;&nbsp;
                        	<select name="txt_mission_state" id="txt_mission_state" class="ui_select01">
                        	<option value="" selected="selected"> </option>
                            <option value="可分配">可分配</option>
                            <option value="已分配">已分配</option>
                        	</select>
						</div>
						<div id="box_bottom">
							<input type="button" value="查询所有" class="ui_input_btn01"
							onclick="javascript:document.submitForm.action='Substation_mission';document.submitForm.submit()"/>
							<input type="button" value="查询" class="ui_input_btn01"
							onclick="javascript:document.submitForm.action='Substation_mission?operation=query';document.submitForm.submit()"/> 
						</div>
					</div>
				</div>
			</div>
			<div class="ui_content">
				<div class="ui_tb">
					<table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<tr>
							<th>任务号</th>
							<th>客户姓名</th>
							<th>投递地址</th>
							<th>商品名称</th>
							<th>商品数量</th>
							<th>要求完成日期</th>
							<th>任务类型</th>
							<th>任务状态</th>
							<th>操作</th>
						</tr>
							<c:if test="${arr!=null}">
								<c:forEach items="${arr}" var="tp">
								<tr>
									<%-- <td><input type="checkbox" name="IDCheck" value="14458579642011" class="acb" /></td> --%>
										<td>${tp.mission_id }</td>
										<td>${tp.user_nick }</td>
										<td>${tp.address }</td>
										<td>${tp.product_name }</td>
										<td>${tp.product_number }</td>
										<td>${tp.deadline }</td>
										<td>${tp.mission_type }</td>
										<td>${tp.mission_state }</td>
										<td>
											<c:if test="${tp.mission_state=='可分配'}">
												<input type=button class="ui_input_btn01" value="分配任务" 
												onclick="javascript:document.submitForm.action='Substation_mission?operation=distribute&txt_order_id=${tp.order_id}';document.submitForm.submit()">
											</c:if>
											<c:if test="${tp.mission_state=='已分配'}">
												<input type=button class="ui_input_btn01" value="撤销" 
												onclick="javascript:document.submitForm.action='Substation_mission?operation=cancel&txt_order_id=${tp.order_id}';document.submitForm.submit()">
											</c:if>
										</td>
								</tr>
								</c:forEach>
							</c:if>
					</table>
				</div>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
    var eitem = document.getElementById("add_alpha_id");
    window.onload = add_alpha(eitem);
</script>
</body>
</html>
